﻿<UserControl x:Class="jSLApp.Client.Controls.SoundPlayer.EasyPlayer"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:SoundPlayer="clr-namespace:jSLApp.Client.Controls.SoundPlayer" xmlns:tk="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit" mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400">
    <!--<UserControl.Resources>
        <Storyboard x:Name="PlayPlaying" RepeatBehavior="Forever">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="image">
                <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="1"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.6" Value="0"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="image1">
                <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="0"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.6" Value="1"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.9" Value="0"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="image2">
                <EasingDoubleKeyFrame KeyTime="0" Value="1"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="0"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.7" Value="0"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.9" Value="1"/>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
    </UserControl.Resources>            -->
        <tk:DockPanel LastChildFill="True">
            <Image Name="playStop" Source="../../Resources/player/play_Disabled.png" Width="16" Height="16" Margin="5" Cursor="Hand" MouseLeftButtonDown="playStop_Clicked" tk:DockPanel.Dock="Left"/>
            <StackPanel Orientation="Horizontal" tk:DockPanel.Dock="Right">
                <Image VerticalAlignment="Center" Width="16" Height="16" Source="../../Resources/player/error.png" Name="failImage" Visibility="Collapsed" ToolTipService.ToolTip="Не удалось воспроизвести файл"  Margin="0"/>
                <!--<StackPanel Name="playingPanel" Orientation="Horizontal" VerticalAlignment="Center" Margin="5">
                    <Image x:Name="image" Width="16" Height="16" Source="../../Resources/player/PlayMini.png" Opacity="0"  Margin="0"/>
                    <Image x:Name="image1" Width="16" Height="16" Source="../../Resources/player/PlayMini.png" Opacity="0"  Margin="0"/>
                    <Image x:Name="image2" Width="16" Height="16" Source="../../Resources/player/PlayMini.png" Opacity="0"  Margin="0"/>
                </StackPanel>-->
                <MediaElement 
            Name="mainPlayer" 
            AutoPlay="False"
            Volume="1"
            BufferingTime="0:0:30"             
            MediaEnded="media_Ended"
            MediaFailed="media_Failed"     
            MediaOpened="opened"/>
            </StackPanel>
            <SoundPlayer:EasySlider Margin="5" x:Name="curPosition" Seek="pos_Seeked" IsEnabled="False" Height="16"/>
        </tk:DockPanel>
</UserControl>
